package com.galaxy.device.domain.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.common.translation.annotation.Translation;
import com.galaxy.common.translation.constant.TransConstant;
import com.galaxy.device.domain.*;
import com.galaxy.device.domain.convert.DeviceMachineTypeConvert;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMapping;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.List;

/**
 * 设备基础信息视图对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = DeviceBase.class)
public class DeviceBaseVo extends BaseEntity {

    /**
     * 设备ID
     */
    private Long id;

    /**
     * 设备编号
     */
    @ExcelProperty(value = "设备编号")
    private String deviceNo;

    /**
     * 设备名称
     */
    @ExcelProperty(value = "设备名称")
    private String deviceName;

    /**
     * 设备序列号
     */
    @ExcelProperty(value = "设备序列号")
    private String sn;

    /**
     * 设备型号
     */
    @ExcelProperty(value = "设备型号")
    private String model;

    /**
     * 机器类型ID
     */
    @ExcelProperty(value = "机器类型ID")
    private Long machineTypeId;

    /**
     * 商品类型ID
     */
    @ExcelProperty(value = "商品类型ID")
    private Long productCategoryId;

    /**
     * 商品类型名称
     */
    @ExcelProperty(value = "商品类型名称")
    private String productCategoryName;

    /**
     * 管理员ID
     */
    @ExcelProperty(value = "管理员ID")
    private Long managerId;

    /**
     * 管理员名称
     */
    @ExcelProperty(value = "管理员名称")
    private String managerName;

    /**
     * 通道总数
     */
    @ExcelProperty(value = "通道总数")
    private Integer channelCount;

    /**
     * 状态(0:离线,1:在线,2:故障,3:维护中)
     */
    @ExcelProperty(value = "状态")
    private Integer status;

    /**
     * 状态名称
     */
    @ExcelProperty(value = "状态名称")
    private String statusName;
    /**
     * 头像地址
     */
    @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "imgUrl")
    private String imgUrl;

    @TableField(exist = false)
//    @AutoMapping(target = DeviceMachineType.class, qualifiedBy = DeviceMachineTypeConvert.class)
    private DeviceMachineType deviceType;

    @TableField(exist = false)
    private DeviceLocation location;

    @TableField(exist = false)
    private List<DeviceStock> deviceStock;

    @TableField(exist = false)
    private List<DeviceChannel> deviceChannel;
}
